<?php
/**
 * GioCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@ninhgio.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2010-2011 GioCMS (http://cms.ninhgio.com)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @author		NinhGio - ninhgio@gmail.com
 * @since		1.0
 */
?>
<?php if (isset($this->widgets) && $this->widgets) : ?>
<?php foreach ($this->widgets as $index => $widget) : ?>
<?php if ($index > 0 && $index % 3 == 0) : ?>
<div class="clear"></div>
<?php endif; ?>
<div class="col w33" id="gCoreWidget_<?php echo $widget['module_id']; ?>_<?php echo $widget['widget_id']; ?>">
	<div style="text-align: center;">
		<img id="<?php echo $widget['module_id']?>_<?php echo $widget['widget_id']; ?>" class="g_core_widgettoolbox_draggable" title="<?php echo $this->TRANSLATOR->widget($widget['description'], $widget['module_id'], $widget['widget_id']); ?>" src="<?php echo sprintf('%s/modules/%s/widgets/%s/thumbnail_48.png', $this->APP_STATIC_SERVER, $widget['module_id'], $widget['widget_id']); ?>" width="48" height="48" /><br />
		<span style="font-size: 11px; font-weight: bold;"><?php echo $this->TRANSLATOR->widget('about_title', $widget['module_id'], $widget['widget_id']); ?></span>
	</div>
</div>
<?php endforeach; ?>
<script type="text/javascript">
$(document).ready(function() {
	/**
	 * Allows user to drag the widgets
	 */
	$('.g_core_widgettoolbox_draggable').css('cursor', 'move').draggable({
		zIndex: 1000,
		cursor: 'pointer',
		helper: 'clone',
		revert: 'invalid'
	}).disableSelection();
});
</script>
<?php else : ?>
<p><b><?php echo $this->TRANSLATOR->widget('widget_data_notfound'); ?></b></p>
<?php endif; ?>
<div class="clear"></div>